package com.hrbxlh.virtualization.constant;

import com.hrbxlh.virtualization.util.PropertiesUtil;

/**
 * @author cheer
 */
public final class NovncConstant {

    /**
     * Novnc代理IP
     */
    public static final String NOVNC_HOST_IP =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-host-ip");

    /**
     * Novnc SSH IP
     */
    public static final String NOVNC_SSH_IP =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-ssh-ip");

    /**
     * Novnc代理主机用户名
     */
    public static final String NOVNC_HOST_USERNAME =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-host-username");

    /**
     * Novnc代理主机密码
     */
    public static final String NOVNC_HOST_PASSWORD =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-host-password");

    /**
     * Novnc代理端口
     */
    private static final String NOVNC_PORT =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-port");

    /**
     * Novnc代理主机ssh端口
     */
    public static final String NOVNC_HOST_SSH_PORT =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-host-ssh-port");

    /**
     * Novnc token 目录
     */
    private static final String NOVNC_TOKEN_DIR =
            PropertiesUtil.getProperty(GlobalConstant.VIRTUALIZATION_CONFIG_FILE, "novnc-token-dir");

    /**
     * 写入token的shell命令
     * 第一个 %s 为rancherId
     * 第二个 %s 为vnc服务ip
     * 第三个 %s 为vnc服务端口
     * 第四个 %s 为rancherId
     */
    public static final String WRITE_TOKEN_CMD = "echo %s: %s:%s > " + NOVNC_TOKEN_DIR + "%s";

    /**
     * Novnc访问地址
     * 第一个 %s 为rancherId
     */
    public static final String NOVNC_URL = "/vnc_auto.html?host=%s&port=" + NOVNC_PORT + "&path=websockify/?token=%s";

}
